//2009/10/20 19:49:18
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class BoredPhilosophers
{
public:
    vector <int> simulate(vector <string> t, int N)
    {

        vector<int> v(N,0);
        string ss;
        vector<string> text;
        for (int i=0; i<t.size(); i++)
            ss += t[i];
        stringstream s(ss);
        string x;
        while (s >> x) text.push_back(x);
        for (int i=1; i<=N; i++)
        {
            set<vector<string> > train;
            for (int j=0; j+i-1<text.size(); j++)
            {
                vector<string> test;
                for (int m=j; m<i+j; m++) test.push_back(text[m]);
                int sz = train.size();
                train.insert(test);
                if (train.size() > sz) v[i-1] ++;
            }
        }
        return v;
    }
};
